From: Juergen Gross Date: Tue, 9 Jun 2020 14:48:50 +0000 (+0200) Subject: tools: fix setting of errno in xenhypfs_read_raw() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~89 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=058023b343d4e366864831db46e9b438e9e3a178;p=xen.git tools: fix setting of errno in xenhypfs_read_raw() Setting of errno is wrong in xenhypfs_read_raw(), fix it. Reported-by: George Dunlap Fixes: 86234eafb9529 ("libs: add libxenhypfs") Signed-off-by: Juergen Gross Reviewed-by: Paul Durrant Release-acked-by: Paul Durrant Acked-by: Wei Liu --- diff --git a/tools/libs/hypfs/core.c b/tools/libs/hypfs/core.c index fc23b02586..f94c5ea1e2 100644 --- a/tools/libs/hypfs/core.c +++ b/tools/libs/hypfs/core.c @@ -241,10 +241,8 @@ void *xenhypfs_read_raw(xenhypfs_handle *fshdl, const char *path, if (!ret) break; - if (ret != ENOBUFS) { - errno = -ret; + if (errno != ENOBUFS) goto out; - } } content = malloc(entry->content_len);